

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>入门必看 &mdash; CherryUSB 1.4.2 documentation</title>
      <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
      <link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />

  
      <script src="../_static/jquery.js?v=5d32c60e"></script>
      <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="../_static/documentation_options.js?v=02f2166e"></script>
      <script src="../_static/doctools.js?v=9a2dae69"></script>
      <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="基于现有 demo 快速验证" href="demo.html" />
    <link rel="prev" title="CherryUSB 使用指南" href="../index.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            CherryUSB
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">快速上手</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">入门必看</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">第一步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">第二步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">第三步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">第四步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id6">第五步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id7">第六步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id8">第七步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id9">第八步</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id10">第九步</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="demo.html">基于现有 demo 快速验证</a></li>
<li class="toctree-l1"><a class="reference internal" href="transplant.html">芯片通用移植指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="rtthread.html">基于 RT-Thread 软件包开发指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="esp.html">基于 ESP-Registry 开发指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../q%26a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="../opensource.html">官方开源项目分享</a></li>
<li class="toctree-l1"><a class="reference internal" href="../share.html">开发者经验/开源项目分享</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">USB 基本知识点</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb2.0_basic.html">USB 基本概念(2.0 为主)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb3.0_basic.html">USB 基本概念(3.0 为主)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_desc.html">USB 描述符</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_request.html">USB 设备请求</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_enum.html">USB 枚举</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_ext.html">USB 知识点拓展</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API 手册</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api/api_device.html">设备协议栈</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/api_host.html">主机协议栈</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/api_port.html">主从驱动</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/api_config.html">USB CONFIG 说明</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Class 指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../class/class_cdc.html">CDC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_hid.html">HID</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_msc.html">MSC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_audio.html">UAC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_video.html">UVC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/winusb.html">WINUSB</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">例程说明</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_cdc_acm.html">usbd_cdc_acm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_hid.html">usbd_hid</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_msc.html">usbd_msc</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_rndis.html">usbd_rndis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_ecm.html">usbd_cdc_ecm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_audiov1.html">usbd_audiov1</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_audiov2.html">usbd_audiov2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_video.html">usbd_video</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_winusb.html">usbd_winusb</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_webusb.html">usbd_webusb</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_serial.html">usbh_serial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_hid.html">usbh_hid</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_msc.html">usbh_msc</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_net.html">usbh_net</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_bluetooth.html">usbh_bluetooth</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_wifi.html">usbh_wifi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_vendor.html">vendor device 驱动编写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_vendor.html">vendor host 驱动编写</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">USBIP 介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../usbip/ohci.html">OHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/ehci.html">EHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/xhci.html">XHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/chipidea.html">CHIPIDEA</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/dwc2.html">DWC2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/musb.html">MUSB</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/fotg210.html">FOTG210</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/cdns2.html">CDNS2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/cdns3.html">CDNS3</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/dwc3.html">DWC3</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">工具使用</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">chryusb_configurator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#usb-protocol-suite">力科 USB Protocol Suite</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#wireshark">Wireshark</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#audacity">Audacity</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">版本说明</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../version.html">版本说明</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">商业支持</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../support/index.html">商业支持</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">CherryUSB</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">入门必看</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/quick_start/start.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="id1">
<h1>入门必看<a class="headerlink" href="#id1" title="Link to this heading"></a></h1>
<p>首先欢迎大家来到 usb 的世界，在这里你可以学习到 usb 各种知识以及 cherryusb 的移植使用进阶等等。但是呢，刚进来的你，一定很懵懂，因为 USB 很难（其实当你学会了 cherryusb以后，你会发现，USB 一点都不难），
那么这种情况下，你的学习路线，应该是怎么样呢？在这里，我推荐大家是按照我得学习路线来学习，这样对你的 USB 成长是最有帮助的，并且你也不会中途放弃。</p>
<p>首先，不允许上来就看概念，有句古诗说的好， <strong>纸上得来终觉浅，绝知此事要躬行</strong> ，光看纸面上的东西，你是学不到什么的，只有当自己实践了，你才能更深入的了解这些概念。那么作为初学者，你应该怎么做呢？请看以下步骤。</p>
<section id="id2">
<h2>第一步<a class="headerlink" href="#id2" title="Link to this heading"></a></h2>
<p>你需要学过 C 语言，UART, DMA，这是基础，如果没学过，请去学习，不然你会很吃力。你会问 USB 跟 UART/DMA 有什么关系？ 我只能说两个字， <strong>等价</strong></p>
</section>
<section id="id3">
<h2>第二步<a class="headerlink" href="#id3" title="Link to this heading"></a></h2>
<p>下载 demo 工程并跑通能运行， <strong>建议学习慢的，使用 demo 同型号芯片</strong>，学习快的，可以选择自己移植相关支持的型号的芯片。你连 demo 都跑不通，你学什么 USB，你说对不对？</p>
</section>
<section id="id4">
<h2>第三步<a class="headerlink" href="#id4" title="Link to this heading"></a></h2>
<p>非常好，到这步，说明你已经能熟练移植和跑通所有示例了，那么接下来，你应该学习什么呢？ <strong>事务</strong>， <strong>请求</strong> 和 <strong>描述符</strong> （在 USB 的学习过程中，你只需要知道这三个，其余都不需要知道）。</p>
</section>
<section id="id5">
<h2>第四步<a class="headerlink" href="#id5" title="Link to this heading"></a></h2>
<p>首先我们需要知道 USB 事务包含 SETUP/IN/OUT，其实就是等价于发送命令，发送数据和接收数据，很简单。至于下面枚举中你在外面的网络中所听到的控制阶段，数据阶段，状态阶段，他不是事务，他只是用多个事务代表了一个阶段而已。</p>
</section>
<section id="id6">
<h2>第五步<a class="headerlink" href="#id6" title="Link to this heading"></a></h2>
<p>然后你再去看 <strong>USB 枚举</strong> 章节并且知道了一个概念： <strong>描述符</strong> ，这个时候，你就可以去简单看看什么是描述符，有哪些描述符，然后你需要记住， <strong>设备、配置、接口、端点描述符的组成</strong>，并背下来，其余的你都不需要知道，因为其他都是固定的，后续都是 CV 。群文件有各类设备枚举的抓包，可以下下来看看。</p>
</section>
<section id="id7">
<h2>第六步<a class="headerlink" href="#id7" title="Link to this heading"></a></h2>
<p>然后呢，你可以再去看看什么是 <strong>请求</strong> ，请求结构体的组成，看看有哪些请求，简单了解即可，为什么呢？因为它不过就是 8 字节的数据格式，大家都会写一个 UART + 自定义协议，那么 USB 的请求也是一样的，只不过是规定好了而已。</p>
</section>
<section id="id8">
<h2>第七步<a class="headerlink" href="#id8" title="Link to this heading"></a></h2>
<p>这个时候，你该去熟悉下协议栈的一些 API 了，参考 <strong>API 手册</strong> 章节。并且你需要知道中断完成的条件是什么，什么时候算接收完成，什么时候算发送完成，可以参考 <strong>USB 知识点拓展</strong> 章节。</p>
</section>
<section id="id9">
<h2>第八步<a class="headerlink" href="#id9" title="Link to this heading"></a></h2>
<p>到这步呢，你肯定已经非常懂了，然后就可以开始你的一些小功能小项目了，在此期间呢，请循环查看 <strong>USB 知识点拓展</strong> 章节，直到你真的理解了，因为这些内容是非常重要的，会影响我们代码的执行结果。</p>
</section>
<section id="id10">
<h2>第九步<a class="headerlink" href="#id10" title="Link to this heading"></a></h2>
<p>都到这步了，你应该不需要我了，这个时候，你可以去看看 USB 概念，看看 USB 的一些细节，看看 CherryUSB 的代码流程了。然后就是巩固巩固再巩固了。恭喜你，出师了！！！</p>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../index.html" class="btn btn-neutral float-left" title="CherryUSB 使用指南" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="demo.html" class="btn btn-neutral float-right" title="基于现有 demo 快速验证" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2022 ~ 2024, sakumisu.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>